package fit.conceptmap.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;

import fit.conceptmap.services.IUserService;

@Controller
@SessionAttributes({"username", "role" })
public class NavigationController {
	
	@Autowired
	IUserService userService;
	
	private static final Logger logger = Logger.getLogger(NavigationController.class);
	
	@RequestMapping(value = "/conceptmaps", method = RequestMethod.GET)
	public String goWelcomeDoGet(Model model, @ModelAttribute(value="username") String session) {
		return "conceptmaps";
	}
	
	@RequestMapping(value = "/getfile", method = RequestMethod.GET)
	public String goFiles(Model model, @ModelAttribute("username") String username) {
		return "draw";
	}
	
	@RequestMapping(value = "/account", method = RequestMethod.GET)
	public String goAccount(Model model) {
		return "account";
	}
	
	@RequestMapping(value = "/message", method = RequestMethod.GET)
	public String goMessage(Model model) {
		return "message";
	}

	@RequestMapping(value = "/assignment", method = RequestMethod.GET)
	public String goAssignment(Model model) {
		return "assignment";
	}
	
	@RequestMapping(value = "/goRegister", method = RequestMethod.GET)
	public String goRegister() {
		return "register";
	}
	
	/*@RequestMapping(value = "/goProfileUser", method = RequestMethod.GET)
	public String goUpdateProfile(Model model, @ModelAttribute(value="username") String username) {
		model.addAttribute("user", userService.getUserByUsername(username));
		return "profile";
	}*/
	
	@RequestMapping(value = "/createAssignment", method = RequestMethod.GET)
	public String createAssignment() {
		return "createAssignment";
	}
}
